﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace HZY.App.Controllers
{
    using HZY.Toolkit;

    [Route("api/[controller]")]
    [ApiController]
    public class ApiBaseController : ControllerBase
    {
        public ApiBaseController() { }

        public ApiResult ApiResult() => new ApiResult() { Code = (int)ApiResultCodeEnum.成功 };

        public ApiResult ApiResult<T>(T result) => new ApiResult() { Code = (int)ApiResultCodeEnum.成功, Result = result };

        public ApiResult ApiResultError(string result) => new ApiResult() { Code = (int)ApiResultCodeEnum.错误, Result = result };

        public ApiResult ApiResultNoAuth(string result) => new ApiResult() { Code = (int)ApiResultCodeEnum.未授权, Result = result };

    }
}